package leetcode.动态规划;

public class 判断子序列392 {
    public boolean isSubsequence(String s, String t) {
        int i = 0;
        for (int j = 0; i < s.length() && j < t.length(); j++) {
            if (s.charAt(i) == t.charAt(j)) {
                i++;
            }
        }
        return i == s.length();
    }

    public static void main(String[] args) {
        new 判断子序列392().isSubsequence("ab","baab");
    }
}
